The present invention relates to control flow graphs and, more specifically, to simplifying a control flow graph based on profiling data.
A control flow graph (CFG) is a representation in graph notation of paths that could be traversed through a project, which can include one or more programs, during execution. In other words, a CFG shows the control flow of a project. Conventionally, a CFG shows all possible paths.
A CFG generally includes a set of graph nodes and a set of directed edges connecting those graph nodes. Each graph node of the CFG represents a node of a program in the project, also referred to as a program node, a statement, or a basic block. A program node is a portion of code within the project with only one entry point and only one exit point. Each edge of the CFG starts at a respective first graph node representing a first program node and terminates at a respective second graph node representing a second program node. Such an edge indicates that execution can flow directly from the first program node to the second program node, without passing through any other program nodes.
CFGs help users understand the design of large projects. From a programmer's perspective, a CFG can help the programmer determine how to approach revisions. For a marketing team, a CFG can help describe the project. For an end user, a CFG can describe a project's capabilities and how to use those capabilities.